#!/bin/sh
# ------------------------------------------------------------------------
# The agavi build script for Unix based systems
# 
# If using svn..
# Copy into your path somewhere, (cp agavi-dist ~/bin)
# change it's name to 'agavi', (mv ~/bin/agavi-dist ~/bin/agavi)
# fix the AGAVI_INSTALLATION variable as noted below, (sed -i 's#@PEAR-DIR@/agavi#/var/www/agavi/src#' ~/bin/agavi)
# then type 'agavi', (agavi)
# happyness ensues.
# ------------------------------------------------------------------------

# If using svn, AGAVI_INSTALLATION should point to the full path of your src dir. 
# eg: if agavi is checked out to /var/www/agavi, this should be set to /var/www/agavi/src
AGAVI_INSTALLATION="@PEAR-DIR@/agavi"

# Change this to reflect your environment if the default value doesn't work
PHING_COMMAND="phing"
PWD_PATH=$(pwd)
CWD_NAME=$(basename $PWD_PATH)

# -------------------------------------------------------------------------
# Do not change anything below this line unless you know what you're doing.
# -------------------------------------------------------------------------

# (currently this is not reached)
if [ -z "$PHING_COMMAND" ] ; then
	echo "WARNING: PHP_COMMAND environment not set. (Assuming phing on PATH)"
	PHING_COMMAND=php
fi

$PHING_COMMAND -f ${AGAVI_INSTALLATION}/build.xml -Dagavi.dir="${AGAVI_INSTALLATION}" -Dproject.dir="${PWD_PATH}" -Dcwd_name="${CWD_NAME}" $*
